package com.wx.spring.ioc;

import com.wx.spring.ioc.factory.GenericBeanDefinition;

import java.util.*;

/**
 * @author wx
 * @Description: ioc容器
 * @date 2019/1/11 001111:02
 */
public class IocContainer {
    /**
     * 存储xml中Bean的内容的容器
     */
    private static Map<String, GenericBeanDefinition> xmlBeanMap = new HashMap<>();
    /**
     * 存储待实例化的class容器
     */
    private static Set<String> instanceSet = new LinkedHashSet<>();

    /**
     * 存储对象容器 对象驼峰命名 - 对象
     */
    private static Map<String, Object> beanMap = new HashMap<>();

    /**
     * 接口与实现类容器
     */
    private static Map<String, Set<String>> interfaceAndImplMap = new HashMap<>();
    /**
     * Autowire注解的属性名容器
     */
    private static Set<String> myAutowiredSet = new HashSet<>();

    private IocContainer() {
        throw new RuntimeException("禁止实例化");
    }


    public static Map<String, GenericBeanDefinition> getXmlBeanMap() {
        return xmlBeanMap;
    }

    public static Set<String> getInstanceSet() {
        return instanceSet;
    }

    public static Map<String, Object> getBeanMap() {
        return beanMap;
    }

    public static Map<String, Set<String>> getInterfaceAndImplMap() {
        return interfaceAndImplMap;
    }

    public static Set<String> getMyAutowiredSet() {
        return myAutowiredSet;
    }

}
